﻿using System;

namespace H
{
	// Token: 0x0200025B RID: 603
	internal class H_State_Exit : H_State
	{
		// Token: 0x06000FEF RID: 4079 RVA: 0x000667A8 File Offset: 0x000649A8
		public H_State_Exit(H_Members members) : base(members)
		{
		}

		// Token: 0x06000FF0 RID: 4080 RVA: 0x000667B4 File Offset: 0x000649B4
		public override void In(H_State.Message msg)
		{
			H_StyleData styleData = this.members.StyleData;
			if (styleData != null)
			{
				bool flag = false;
				if (styleData.type == H_StyleData.TYPE.PETTING)
				{
					flag = false;
				}
				else if (styleData.type == H_StyleData.TYPE.INSERT)
				{
					flag = true;
				}
				else if (styleData.type == H_StyleData.TYPE.SERVICE)
				{
					flag = styleData.IsInMouth();
				}
				if (flag)
				{
					if ((styleData.detailFlag & 4096) != 0)
					{
						this.members.PlayAnime("InEja_Base", 0.5f);
					}
					else if (this.members.StateMgr.PrevStateID == H_STATE.PRE_INSERT_WAIT)
					{
						this.members.PlayAnime("PreInsertWait", 0.5f);
					}
					else
					{
						this.members.PlayAnime("OutEja_Base", 0.5f);
					}
				}
				else
				{
					this.members.PlayAnime("Wait", 0.5f);
				}
			}
			this.members.param.mouth = H_MOUTH.FREE;
			this.members.EnableTinIK = false;
			this.members.VoiceExpression(H_Voice.TYPE.EXIT);
			this.members.MaleExpression(H_Expression_Male.TYPE.NORMAL);
			this.exit = false;
		}

		// Token: 0x06000FF1 RID: 4081 RVA: 0x000668E8 File Offset: 0x00064AE8
		public override void Main()
		{
			if (!this.exit && this.members.CheckEndVoice())
			{
				this.members.h_scene.Exit();
				this.exit = true;
			}
		}

		// Token: 0x06000FF2 RID: 4082 RVA: 0x0006691C File Offset: 0x00064B1C
		public override void Out()
		{
		}

		// Token: 0x04001156 RID: 4438
		private bool exit;
	}
}
